# more on simple
def ask_ok(prompt, retries=4, reminder='Please Try Again!'):
    while True:
        ok = input(prompt)
        if ok in ('y', 'yes', 'ye'):
            return True
        if ok in ('n', 'no'):
            return False
        retries = retries - 1
        if retries < 0:
            raise ValueError('invalid user response')
        print(reminder)


ask_ok('input your ask:')

i = 5


# The default values are evaluated at the point of function definition in the defining scope
def f(arg=i):
    print(arg)


i = 6
f()  # 5


def f(a, L=[]):
    L.append(a)
    return L


print(f(1))
print(f(2))
print(f(3))


def f(a, L=None):
    if L is None:
        L = []
    L.append(a)
    return L
print(f(1))
print(f(2))
print(f(3))
